package com.infore.dataAudit.entity;

import java.io.Serializable;
import javax.persistence.*;

import java.util.ArrayList;
import java.util.List;


/**
 * The persistent class for the T_TEST_CLASS database table.
 * 
 */
@Entity
@Table(name="T_TEST_CLASS")
@NamedQuery(name="TTestClass.findAll", query="SELECT t FROM TTestClass t")
public class TTestClass implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	private String name;

	//bi-directional many-to-one association to TTestStudent
	@OneToMany(mappedBy="TTestClass", cascade = {CascadeType.ALL})
	private List<TTestStudent> TTestStudents = new ArrayList<>();

	public TTestClass() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<TTestStudent> getTTestStudents() {
		return this.TTestStudents;
	}

	public void setTTestStudents(List<TTestStudent> TTestStudents) {
		this.TTestStudents = TTestStudents;
	}

	public TTestStudent addTTestStudent(TTestStudent TTestStudent) {
		getTTestStudents().add(TTestStudent);
		TTestStudent.setTTestClass(this);

		return TTestStudent;
	}

	public TTestStudent removeTTestStudent(TTestStudent TTestStudent) {
		getTTestStudents().remove(TTestStudent);
		TTestStudent.setTTestClass(null);

		return TTestStudent;
	}

}